package config

import (
	"fmt"
)

var CkTableReport = "hxdb_stg.adx_reportV2"
var CkTableDspReport = "hxdb_stg.dsp_reportV2"
var CkTableSspReport = "hxdb_stg.ssp_reportV2"

// 列表数据返回
type DataList struct {
	List     interface{} `json:"list"`
	PageSize int64       `json:"pageSize"`
	PageNum  int64       `json:"pageNum"`
	Total    int64       `json:"total"`
}

func GetCkCount(sql string) int64 {
	sqls := "select count(*) as num from (select count(*) as num from " + sql + ") as a"
	rowc, err := GetCKDB().Query(sqls)
	if err != nil {
		fmt.Println("sql count:error", err.Error())
		return 0
	}
	num := int64(0)
	for rowc.Next() {
		err := rowc.Scan(&num)
		if err != nil {
			fmt.Println("sql count Scan:error", err.Error())
			continue
		}
	}
	return num
}
